Skip to content

Conversation

neithanmo
Copy link
Collaborator

The indexer-service was incorrectly storing V2 (Horizon) receipt CollectionId values in the
database by truncating them from 32 bytes to 20 bytes. This caused TAP agent database notification
parsing to fail.

Root Cause:

In crates/service/src/tap/receipt_store.rs:348-350, the DbReceiptV2::from_receipt() function was
calling .as_address() on the CollectionId before encoding:

let collection_id = thegraph_core::CollectionId::from(receipt.message.collection_id)
    .as_address()  // ❌ This truncates 32-byte CollectionId to 20-byte address
    .encode_hex();

Solution

Remove .as_address() call to store the full 32-byte CollectionId

Is this correct?

  Remove `.as_address()` call that was truncating 32-byte CollectionId
  to 20-byte address, causing parsing issues in tap-agent notifications.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16980480523

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 74.187%

Files with Coverage Reduction New Missed Lines %
crates/watcher/src/lib.rs 4 87.74%
Totals Coverage Status
Change from base Build 16974721353: 0.04%
Covered Lines: 11847
Relevant Lines: 15969

💛 - Coveralls

@suchapalaver
Copy link
Collaborator

I think so! Thanks for this! 🫡

@neithanmo neithanmo merged commit 581c2f0 into main Aug 15, 2025
12 checks passed
@neithanmo neithanmo deleted the fix/collection_id branch August 15, 2025 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants